package com.ruoyi.fpa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.util.SnowFlakeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fpa.mapper.FpaFunctionActionFpaMapper;
import com.ruoyi.fpa.domain.FpaFunctionActionFpa;
import com.ruoyi.fpa.service.IFpaFunctionActionFpaService;

/**
 * FPAService业务层处理
 *
 * @author koradji@163.com
 * @date 2023-09-13
 */
@Service
public class FpaFunctionActionFpaServiceImpl implements IFpaFunctionActionFpaService
{
    @Autowired
    private FpaFunctionActionFpaMapper fpaFunctionActionFpaMapper;

    /**
     * 查询FPA
     *
     * @param id FPA主键
     * @return FPA
     */
    @Override
    public FpaFunctionActionFpa selectFpaFunctionActionFpaById(String id)
    {
        return fpaFunctionActionFpaMapper.selectFpaFunctionActionFpaById(id);
    }

    /**
     * 查询FPA列表
     *
     * @param fpaFunctionActionFpa FPA
     * @return FPA
     */
    @Override
    public List<FpaFunctionActionFpa> selectFpaFunctionActionFpaList(FpaFunctionActionFpa fpaFunctionActionFpa)
    {
        return fpaFunctionActionFpaMapper.selectFpaFunctionActionFpaList(fpaFunctionActionFpa);
    }

    /**
     * 新增FPA
     *
     * @param fpaFunctionActionFpa FPA
     * @return 结果
     */
    @Override
    public int insertFpaFunctionActionFpa(FpaFunctionActionFpa fpaFunctionActionFpa)
    {
        if(StringUtils.isEmpty(fpaFunctionActionFpa.getId())) {
            fpaFunctionActionFpa.setId(String.valueOf(SnowFlakeUtils.snowFlakeId()));
        }
        return fpaFunctionActionFpaMapper.insertFpaFunctionActionFpa(fpaFunctionActionFpa);
    }

    /**
     * 修改FPA
     *
     * @param fpaFunctionActionFpa FPA
     * @return 结果
     */
    @Override
    public int updateFpaFunctionActionFpa(FpaFunctionActionFpa fpaFunctionActionFpa)
    {
        return fpaFunctionActionFpaMapper.updateFpaFunctionActionFpa(fpaFunctionActionFpa);
    }

    /**
     * 批量删除FPA
     *
     * @param ids 需要删除的FPA主键
     * @return 结果
     */
    @Override
    public int deleteFpaFunctionActionFpaByIds(String[] ids)
    {
        return fpaFunctionActionFpaMapper.deleteFpaFunctionActionFpaByIds(ids);
    }

    /**
     * 删除FPA信息
     *
     * @param id FPA主键
     * @return 结果
     */
    @Override
    public int deleteFpaFunctionActionFpaById(String id)
    {
        return fpaFunctionActionFpaMapper.deleteFpaFunctionActionFpaById(id);
    }
}
